package com.mychat.enums;

public enum UserContactStatusEnum {
    NOT_FRIEND(0, "未添加为好友"),
    FRIEND(1, "已添加为好友"),
    DELETED_BY_ME(2, "我删除了该好友"),
    DELETED_BY_FRIEND(3, "对方删除了该好友"),
    BLACK_BY_ME(4, "我拉黑了该好友"),
    BLACK_BY_FRIEND(5, "对方拉黑了该好友");

    private Integer code;
    private String msg;

    UserContactStatusEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static UserContactStatusEnum getByCode(Integer status) {
        for (UserContactStatusEnum statusEnum : UserContactStatusEnum.values()) {
            if (statusEnum.getCode().equals(status)) {
                return statusEnum;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
